import os
from argparse import ArgumentParser

parser = ArgumentParser()
parser.add_argument('--observation', type=float, default=1.0)
parser.add_argument('--dataset', type=str, default='topic')
parser.add_argument('--n_time_interval', type=int, default=6)
args = parser.parse_args()

deep_learning_config = f'''import math
DATA_PATHA = "../dataset"
#filepath
cascade_train  = DATA_PATHA+"/cascade_train.txt"
cascade_val = DATA_PATHA+"/cascade_val.txt"
cascade_test = DATA_PATHA+"/cascade_test.txt"
shortestpath_train = DATA_PATHA+"/shortestpath_train.txt"
shortestpath_val = DATA_PATHA+"/shortestpath_val.txt"
shortestpath_test = DATA_PATHA+"/shortestpath_test.txt"
train_pkl = DATA_PATHA+"/data_train.pkl"
val_pkl = DATA_PATHA+"/data_val.pkl"
test_pkl = DATA_PATHA+"/data_test.pkl"
information = DATA_PATHA+"/information.pkl"

#parameters
observation = {args.observation}*60*60-1
print("observation time",(observation+1)//3600,'hours')
n_time_interval = {args.n_time_interval}
print("the number of time interval:",n_time_interval)
time_interval = math.ceil((observation+1)*1.0/n_time_interval)
print("time interval:",time_interval)


'''
gen_sequence_config = f'''DATA_PATHA = "../dataset"
cascades  = DATA_PATHA+"/dataset_{args.dataset}0.txt"
cascade_train  = DATA_PATHA+"/cascade_train.txt"
cascade_val = DATA_PATHA+"/cascade_val.txt"
cascade_test = DATA_PATHA+"/cascade_test.txt"
shortestpath_train = DATA_PATHA+"/shortestpath_train.txt"
shortestpath_val = DATA_PATHA+"/shortestpath_val.txt"
shortestpath_test = DATA_PATHA+"/shortestpath_test.txt"
observation_time = 3600*{args.observation}

'''
deep_learning_config_path = os.path.join('deep_learning', 'config.py')
gen_sequence_config_path = os.path.join('gen_sequence', 'config.py')

with open(deep_learning_config_path, 'w', encoding='utf8') as f:
    f.write(deep_learning_config)
with open(gen_sequence_config_path, 'w', encoding='utf8') as f:
    f.write(gen_sequence_config)